Skip to content

Fix MusicXML export losing measure boundaries with chords#183

Merged
bmjcode merged 1 commit intofrescobaldi:masterfrom
hexbold:fix-musicxml-chord-bar-duration
Apr 4, 2026
Merged

Fix MusicXML export losing measure boundaries with chords#183
bmjcode merged 1 commit intofrescobaldi:masterfrom
hexbold:fix-musicxml-chord-bar-duration

Conversation

@hexbold
Copy link
Copy Markdown
Contributor

@hexbold hexbold commented Jan 26, 2026

Chords were not incrementing the bar duration counter, causing measure boundaries to be lost in MusicXML export. A 3-bar piece with chords would incorrectly export as 2 bars.

Two functions affected:

  • new_chordbase(): explicit chord notation
  • copy_prev_chord(): duration shorthand after chords (4 4)

Added self.increase_bar_dura(duration) to both functions to match the behavior of regular notes.

Fixes #171

Chords were not incrementing the bar duration counter, causing measure
boundaries to be lost in MusicXML export. A 3-bar piece with chords
would incorrectly export as 2 bars.

Two functions affected:
- new_chordbase(): explicit chord notation <c e g>
- copy_prev_chord(): duration shorthand after chords (4 4)

Added self.increase_bar_dura(duration) to both functions to match the
behavior of regular notes.

Fixes frescobaldi#171
@fedelibre
Copy link
Copy Markdown
Member

I've just realized there's this open PR.
@bmjcode @PeterBjuhr can you review it?

Copy link
Copy Markdown
Collaborator

@bmjcode bmjcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I confirmed this fixes the problem by importing the MusicXML into my old copy of Finale.

@bmjcode bmjcode merged commit 8d18a16 into frescobaldi:master Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MusicXML: Chords cause bar lines to be skipped

3 participants